package com.bw.lib_database

import androidx.room.AutoMigration
import androidx.room.Database
import androidx.room.RoomDatabase
import com.baway.db.dao.UserInfoDao
import com.baway.db.entity.UserInfo


/**
 * Author: Jason Zhang
 * Date: 2025/8/22
 * Desc: 自定义Room数据库
 */

@Database(
    entities = [UserInfo::class], //代表有多少张表
    version = 2,                  //代表当前数据库版本号
    exportSchema = true,          //是否支持数据库协议导出，数据库升级时必须设置为true
    autoMigrations = [
//        AutoMigration(from = 1, to = 2, spec = UserInfoTableNameMigration::class),
//        AutoMigration(from = 1, to = 2, spec = UserInfoColumnNameMigration::class),
    ], //数据库升级策略

)
abstract class AppDataBase: RoomDatabase() {

    //定义获取操作Dao抽象方法
    abstract fun getUserInfoDao(): UserInfoDao


}